package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号 沙箱的appid
	public static String app_id = "2021000118648999";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCtJF4NeckYm5K/K8C7XK5PFvwQ+rr13YSx6rQga+aDw+O4PiOcACbSbZcwc/Xn139N9pFeYWc3wF7T+LP4VXC/2UAQ2IE0NjmHJWi6wSdVz5oR8xw5IrMBUHsgT/Po7f3zPdqsmtceVrIpUf6Hbux6cjw1UIIt6b06BMBFAH4pn/zXrjPn6Gc8YphUQFMasj7D3DKEAs/ojGKchObwakewnWdjnL/xJv6C14X2wE12bWYx0pap+Ezsbox6lSACUMEUI0hDefIwqQnWNAOTkcuTzK2Ega//jfVCr7NFnIVP+PYOIuVew63M0aBXyjbOehMbnBQrtybWrg3RUah5TuD/AgMBAAECggEBAJKxq1YzhuPoe66o/URBRBYSXUJtjJXfNxwexLprcQTWpUtmqnjzz/CdlWkh9oiVlnCRpZyXXgJoZG+n2aNfkIWbJaKgLOf1wUv1sAP6vr7/g4QNvC3UbmGAtLEtzHPfoDfEgk+XaQd1YMGNjN9mZclgnA53xbPsw7wyZkyQHFRaqYvhG9G+Y9OuRnauW8AisNSTYP0HanJ44i4vIbOkYD6LkGjXzLAew6FChSpmKTTu79ZDi3U5VTMieMJ9zAt/6UsVmYUxfSDhCMaJbPKcQ22qoopWp3s8i5fCcjvgwQ1jmTbSROwLNA++2rvZJPIf8D7SMkKD67Nn0SRJ7by8VWECgYEA3QPVTAppnUTCZdr8IbeJ37sCGEwAZEGeh8RGOMlpXVHHXl84VgTzmEKxsZHJlBb9Rx5AZMwciHbyHEyUy+w8hyXKCeog2yIVgqutyC4uR7we7fCqFXim1C4aAw2iof5A2dV6xUFZmxENTMeqlThfiiaRoxdL6vSzxLx/ltIc3ZcCgYEAyIyVycOl6kujEG9XRNwPZ+F8qOa09UZMD9UTdmF5FTc7sPlc8m3nkV4PSFfRXz4c6uiDJcZEiui7AKX9iDS/eSnWeEoeoMdYErxXwtLFT88q4mHGwgLqKLkfVC7tBUBhgTTstjO/LoChBs4PmgKXvnQQ4dRoEfVYA3HO+Hoa1NkCgYA0zfemJU66fnUbtMhMnfdY9us3NuFZErx3n5NPef+shh9mEsX491Hj7Ptbe4N32E5HMZkc/A9NI24RCNL8LcMAXyz4VXHoKSqOf8oTa8Uu6mlRXBCm9J6XTzRzykwy+/YulWyxuD1aaSaOU54T7NYWwcRF/QjsZ+6TcJ3jQOwYnQKBgECk+F96HlAgo2ZXzXSXzqt4hptXCnuJdlkgIM7m6oXJMQeBydEnVh6IiDqUfBvMRLv/yM5zU4LHNAgoeUnfXtzqfIR3t9mxiBU5+rwE/q8UI0mnpM7C68HGsm+LVMF9mDBy495zXavasI0l/Ody8IDmns58jjNDt2Qc2k9D5MQ5AoGBAKtvG8Km6wFTzgBY9noccwqC6YR/MllASo2ahEWJmexapCS9qg6SwgAI0cINXC+48q+6+Mrs+Dki/wioOKiOEgu+RUwkD/rtJa2m36CDTcyqy8P3F3BGQyJOfxiTAN0uIV/GWgXvvFHOPOpLJkGO4mTAVyPpWVa9ymdQcuteoIGL";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm3Nq07EEr/PMDWhjpY48fCubcPqUg2/3XYX6BOG9ZHrItz1MhA4DktXdXHKKfpPwV9+OT9UTsGXZy6VvAElRDBNvi8rF7mq9y7fkLMH4CQk2CKyypXSZOq9QZP3Pva4/8zLhtkrKKak8XdLnbB9REAP8qmkKwXQy5gnf2ihcq9aggwwDJAisW1oR/Ei9yErq4EPqS8wQjKQ2+QWPY/zJWUeUDumE4ZDRCvVR8ictKAlfXX+airEPq+IRmP3y2icyUtyBL/QkVBMD/ukmbQqjKYaINizhLlo3fpN/ANce5zQP0bRtWXiA2lZOaWkxhZIf+47e5dFge3M413vP0kEQ0QIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://qvqmci.natappfree.cc/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://qvqmci.natappfree.cc/return_url.jsp";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关   没有dev就是正式的网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

